package com.josn.pojo;

import com.josn.anno.State;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.URL;

import java.time.LocalDateTime;

@Data
public class Article {
    private Integer id;
    @NotEmpty
    @Pattern(regexp = "^\\{1,10}$")
    private String title;   //文章标题
    @NotEmpty
    private String content; //文章内容
    @NotEmpty
    @URL
    private String cover_img;//文章封面
    @State
    private String state;   //文章状态
    @NotNull
    private Integer category_id;//文章分类id
    @NotEmpty
    private Integer create_user;//用户id
    private LocalDateTime update_time;//修改时间
    private LocalDateTime create_time;//创建时间

}
